#include <bits/stdc++.h>
using namespace std;
#define int long long
void solve()
{
    int n,mn,mx;
    cin>>n>>mn>>mx;
    vector<int> v(n+1);
    for(int i=1;i<=n;i++)
    {
        cin>>v[i];
    }
    int l=1,r=1,ans=0;
    int tmp=0;
    while(r<=n)
    {
        while(r<=n&&tmp<mn)
        {
            tmp+=v[r++];
        }
        while(l<r&&tmp>mx)
        {
            tmp-=v[l++];
        }
        if(tmp>=mn&&tmp<=mx)
        {
            ans++;
            l=r;
            tmp=0;
        }
    }
    cout<<ans<<endl;
}
signed main()
{
    //ios::sync_with_stdio(false);
    //cin.tie(nullptr);
    int T=1;
    cin>>T;
    while(T--)
    {
       solve();
    }
    return 0;
}